<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>    {% block title %}{% endblock %}-知乎(伪)</title>
    <link rel="stylesheet" href="{{ url_for('static',filename='bootstrap/css/bootstrap.css') }}">
    <script type="text/javascript" src="{{ url_for('static',filename='js/jquery-3.2.1.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static',filename='bootstrap/js/bootstrap.js') }}"></script>
    <link rel="stylesheet" href="{{ url_for('static',filename='css/base.css') }}">
    {% block head %}{% endblock %}
</head>
<body>

<div>
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <img class="logo" src="{{ url_for('static',filename ='image/log.jpg') }}"/>


            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="{{ url_for('index') }}">首页 <span class="sr-only">(current)</span></a>
                    </li>
                    <li><a href="{{ url_for('question') }}">提问</a></li>
                </ul>
                <form class="navbar-form navbar-left">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="搜索你感兴趣的内容…">
                    </div>
                    <button type="submit" class="btn btn btn-primary">提问</button>
                </form>
                <ul class="nav navbar-nav navbar-right">
                    {% if user %}
                        <li><a href="#">{{ user.username }}</a></li>
                        <li><a href="{{ url_for('logout') }}">注销</a></li>
                    {% else %}
                        <li><a href="{{ url_for("login") }}">登录</a></li>
                        <li><a href="{{ url_for("register") }}">注册</a></li>
                    {% endif %}

                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
</div>

<div class="main">
        {% with errors=get_flashed_messages() %}
            {% for error in errors %}
                <li><span class="error">ERROR:{{ error }}</span></li>
            {% endfor %}
        {% endwith %}

    {% block main %}{% endblock %}
</div>

</body>
</html>